<?php 
namespace Home\Controller;
use OT\DataDictionary;
class ProductsController extends HomeController {

    public function index(){
        $list = M('goods')->select();
        $picture =M('picture')->getField('id,path');
        $price = M('price')->getField('id,tprice,mprice');
        $cate= M('category')->getField('id,title');
        // var_dump($price);
        foreach ($list as $k => $v) {
            $list[$k]['pic']=$picture[$list[$k]['icon']];
            $list[$k]['cate']=$cate[$list[$k]['cid']];
        }
        // var_dump($list);
        $this->assign('list',$list);
        $this->assign('price',$price);
        $this->assign('page',D('goods')->page);//分页                
        $this->display();
    }

}

 ?>